#ifndef __CHAR_QUEUE_H__
#define __CHAR_QUEUE_H__
#include <typescommon.h>

typedef uint16_t queuetype;
struct queueArrayInformStruct
{
    uint8_t *saveBuf; // 缓冲区
    queuetype windex;
    queuetype rindex;
    queuetype bufLen;
};

void queueArrayInit(struct queueArrayInformStruct *finf, uint8_t *usrp, queuetype savelen);
queuetype queueArrayInputString(struct queueArrayInformStruct *finf, const uint8_t *inbuf, queuetype len);
queuetype queueArraySize(struct queueArrayInformStruct *finf);
queuetype queueArrayGetString(struct queueArrayInformStruct *finf, uint8_t *outbuf, queuetype len);
queuetype queueArrayGetFixedSizeString(struct queueArrayInformStruct *finf, uint8_t *outbuf, queuetype len);
#define charQueueDefIstc(qname, qsize) \
    uint8_t qname##SaveBuffer[qsize];  \
    struct queueArrayInformStruct qname = {qname##SaveBuffer, 0, 0, qsize};
#endif